Add TAL-Reverb-II plugin to test
[juce-lv2.git] / juce / source / extras / audio plugin host / Source / GraphEditorPanel.h
blob2b2521fd019f08ac39603a62e5ea1aab47efcde3
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-9 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCE_FILTERGRAPHEDITOR_JUCEHEADER__
27 #define __JUCE_FILTERGRAPHEDITOR_JUCEHEADER__
29 #include "FilterGraph.h"
31 class FilterComponent;
32 class ConnectorComponent;
33 class PinComponent;
36 //==============================================================================
37 /**
38 A panel that displays and edits a FilterGraph.
40 class GraphEditorPanel : public Component,
41 public ChangeListener
43 public:
44 GraphEditorPanel (FilterGraph& graph);
45 ~GraphEditorPanel();
47 void paint (Graphics& g);
48 void mouseDown (const MouseEvent& e);
50 void createNewPlugin (const PluginDescription* desc, int x, int y);
52 FilterComponent* getComponentForFilter (const uint32 filterID) const;
53 ConnectorComponent* getComponentForConnection (const AudioProcessorGraph::Connection& conn) const;
54 PinComponent* findPinAt (const int x, const int y) const;
56 void resized();
57 void changeListenerCallback (ChangeBroadcaster*);
58 void updateComponents();
60 //==============================================================================
61 void beginConnectorDrag (const uint32 sourceFilterID, const int sourceFilterChannel,
62 const uint32 destFilterID, const int destFilterChannel,
63 const MouseEvent& e);
64 void dragConnector (const MouseEvent& e);
65 void endDraggingConnector (const MouseEvent& e);
67 //==============================================================================
68 private:
69 FilterGraph& graph;
70 ConnectorComponent* draggingConnector;
72 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GraphEditorPanel);
76 //==============================================================================
77 /**
78 A panel that embeds a GraphEditorPanel with a midi keyboard at the bottom.
80 It also manages the graph itself, and plays it.
82 class GraphDocumentComponent : public Component
84 public:
85 //==============================================================================
86 GraphDocumentComponent (AudioDeviceManager* deviceManager);
87 ~GraphDocumentComponent();
89 //==============================================================================
90 void createNewPlugin (const PluginDescription* desc, int x, int y);
92 //==============================================================================
93 FilterGraph graph;
95 //==============================================================================
96 void resized();
98 private:
99 //==============================================================================
100 AudioDeviceManager* deviceManager;
101 AudioProcessorPlayer graphPlayer;
102 MidiKeyboardState keyState;
104 GraphEditorPanel* graphPanel;
105 Component* keyboardComp;
106 Component* statusBar;
108 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GraphDocumentComponent);
111 //==============================================================================
112 /** A desktop window containing a plugin's UI.
114 class PluginWindow : public DocumentWindow
116 PluginWindow (Component* const uiComp,
117 AudioProcessorGraph::Node* owner_,
118 const bool isGeneric_);
120 public:
121 static PluginWindow* getWindowFor (AudioProcessorGraph::Node* node,
122 bool useGenericView);
124 static void closeCurrentlyOpenWindowsFor (const uint32 nodeId);
126 static void closeAllCurrentlyOpenWindows();
128 ~PluginWindow();
130 void moved();
131 void closeButtonPressed();
133 private:
134 AudioProcessorGraph::Node* owner;
135 bool isGeneric;
138 #endif